package com.ruoyi.web.controller.system;

import java.util.ArrayList;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.ApproveTimeoutStatistic;
import com.ruoyi.system.service.IApproveTimeoutStatisticService;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 审批超时Controller
 *
 * @author ruoyi
 * @date 2024-04-12
 */
@RestController
@RequestMapping("/system/statistic")
public class ApproveTimeoutStatisticController extends BaseController
{
    @Autowired
    private IApproveTimeoutStatisticService approveTimeoutStatisticService;

    /**
     * 查询审批超时列表
     */
    @PreAuthorize("@ss.hasPermi('system:statistic:list')")
    @GetMapping("/list")
    public TableDataInfo list(ApproveTimeoutStatistic approveTimeoutStatistic)
    {
        List<ApproveTimeoutStatistic> list = new ArrayList<>();
        approveTimeoutStatisticService.selectApproveTimeoutStatisticList();
        return getDataTable(list);
    }

    /**
     * 获取审批超时详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:statistic:query')")
    @GetMapping("/detail")
    public AjaxResult getInfo(@RequestParam List<String> processDefinitionIdList)
    {
        return success(approveTimeoutStatisticService.selectApproveTimeoutStatisticById(processDefinitionIdList));
    }

}
